<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id='app'>
        <div :style="boxStyle"></div>
        <button @click="change">修改</button>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                boxStyle: {
                    'background-color':'lightblue',
                    height:'300px',
                    1:'测试'
                }
            },
            methods: {
                change(){
                    // console.log(this.boxStyle['background-color']);
                    // console.log(this.boxStyle[1]);
                    this.boxStyle['background-color'] = 'hotpink'
                }
            },
        })
    </script>
</body>

</html>